package com.spsoft.dmzeinvoice.controller;

import com.spsoft.core.annotation.AnonymousAccess;
import com.spsoft.core.model.Result;
import com.spsoft.core.model.leqidmz.param.collect.*;
import com.spsoft.core.model.leqidmz.response.collect.*;
import com.spsoft.dmzeinvoice.common.annotation.DmzLog;
import com.spsoft.dmzeinvoice.service.VmsCollectInvoiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"归集能力模块"})
@RequestMapping("/collect")
@RestController
@RequiredArgsConstructor
public class VmsCollectInvoiceController {

    private final VmsCollectInvoiceService vmCollectInvoiceService;

    @ApiOperation("批量发票下载申请")
    @AnonymousAccess(value = "/batchLoadInvoice", method = RequestMethod.POST, permissionCode = "")
    @DmzLog(leqiName = "批量发票下载申请")
    public Result<BatchLoadInvoiceVO> batchLoadInvoice(@RequestBody BatchLoadInvoiceParam params) {
        return vmCollectInvoiceService.batchLoadInvoice(params);
    }

    @ApiOperation("批量发票下载申请反馈")
    @AnonymousAccess(value = "/batchLoadInvoiceFeedback", method = RequestMethod.POST, permissionCode = "")
    @DmzLog(leqiName = "批量发票下载申请反馈")
    public Result<BatchLoadInvoiceFeedbackVO> batchLoadInvoiceFeedback(@RequestBody BatchLoadInvoiceFeedbackParam params) {
        return vmCollectInvoiceService.batchLoadInvoiceFeedback(params);
    }

    @ApiOperation("查询增量下载发票信息")
    @AnonymousAccess(value = "/incLoadInvoiceQuery", method = RequestMethod.POST, permissionCode = "")
    @DmzLog(leqiName = "查询增量下载发票信息")
    public Result<IncLoadInvoiceQueryVO> incLoadInvoiceQuery(@RequestBody IncLoadInvoiceQueryParam params) {
        return vmCollectInvoiceService.incLoadInvoiceQuery(params);
    }

    @ApiOperation("发票风险信息查询")
    @AnonymousAccess(value = "/invoiceRiskQuery", method = RequestMethod.POST, permissionCode = "")
    @DmzLog(leqiName = "发票风险信息查询")
    public Result<InvoiceRiskQueryVO> invoiceRiskQuery(@RequestBody InvoiceRiskQueryParam params) {
        return vmCollectInvoiceService.invoiceRiskQuery(params);
    }

    @ApiOperation("发票用途状态信息查询")
    @AnonymousAccess(value = "/invoiceUsedStatusQuery", method = RequestMethod.POST, permissionCode = "")
    @DmzLog(leqiName = "发票用途状态信息查询")
    public Result<InvoiceUsedStatusQueryVO> invoiceUsedStatusQuery(@RequestBody InvoiceUsedStatusQueryParam params) {
        return vmCollectInvoiceService.invoiceUsedStatusQuery(params);
    }
}
